﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GuessGameColors
{
    public partial class Form1 : Form
    {
        Randomer game = new Randomer();
        public Form1()
        {
            InitializeComponent();
        }
        
        private void buttonCreateArray_Click(object sender, EventArgs e)
        {
            game._makeRandomArray();
            textBoxGenNumber.Text = (game.fooNum).ToString();
            textBoxGuess.Clear();
            textBoxGuess.BackColor = System.Drawing.Color.White;
        }

        private void buttonGuess_Click(object sender, EventArgs e)
        {

            game._GuessTheNumber(int.Parse(textBoxGuess.Text));
           
            if (game.Connector == 1)
                textBoxGuess.BackColor = System.Drawing.Color.Yellow;
            else if (game.Connector == 2)
                textBoxGuess.BackColor = System.Drawing.Color.YellowGreen;
            else if (game.Connector == 3)
                textBoxGuess.BackColor = System.Drawing.Color.GreenYellow;
            else if (game.Connector == 4)
                textBoxGuess.BackColor = System.Drawing.Color.Green;
            else if (game.Connector == 5)
                textBoxGuess.BackColor = System.Drawing.Color.Orange;
            else if (game.Connector == 6)
                textBoxGuess.BackColor = System.Drawing.Color.OrangeRed;
            else if (game.Connector == 7)
                textBoxGuess.BackColor = System.Drawing.Color.Red;
            else if (game.Connector == 8)
                textBoxGuess.BackColor = System.Drawing.Color.Tomato;
            else if (game.Connector == 9)
                textBoxGuess.BackColor = System.Drawing.Color.Purple;
            else if (game.Connector == 0)
                textBoxGuess.BackColor = System.Drawing.Color.Thistle;
                
            }
        }
    }

